# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=kglobalacceld
pkgver=6.2.3
pkgrel=0
pkgdesc="Daemon providing Global Keyboard Shortcut (Accelerator) functionality"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://invent.kde.org/plasma/kglobalacceld"
license="LGPL-2.0-or-later AND LGPL-2.0-only AND LGPL-2.1-or-later"
depends_dev="$pkgname
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kglobalaccel-dev
	kio-dev
	knotifications-dev
	kservice-dev
	kwindowsystem-dev
	qt6-qtbase-dev
	xcb-util-keysyms-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qttools-dev
	samurai
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-dev"
_repo_url="https://invent.kde.org/plasma/kglobalacceld.git"
case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
source="https://download.kde.org/$_rel/plasma/$pkgver/kglobalacceld-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run -a ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	# We don't ship systemd
	rm -r "$pkgdir"/usr/lib/systemd
}
sha512sums="
eaa5ca449419979416ddf525597cc8da3cdd5b008dfba797eea97912a6db8dcbeea4e1ea0359086149c628536babd356d3297bc1e444a21ed5a65864af9ae3e1  kglobalacceld-6.2.3.tar.xz
"
